import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "../components/Login"
import Login2 from "../components/Login2"
import Financemanagement from "../components/Financemanagement/Financemanagement";
import FinanceLoan from "../components/Financemanagement/FinanceLoan/FinanceLoan";
import FinanceCategory from "../components/Financemanagement/FinanceCategory";
import Finance from "../components/Financemanagement/Finance/Finance";
import InboundOrder from "../components/Material/InboundOrder/InboundOrder";
import FinanceInvoice from "../components/Financemanagement/FinanceInvoice/FinanceInvoice";
import FinanceInvoiceManage from "../components/Financemanagement/FinanceInvoiceManage/FinanceInvoiceManage";
import FinanceReimbursement from "../components/Financemanagement/FinanceReimbursement/FinanceReimbursement";
import AuditRule from "../components/Right/AuditRule/AuditRule";
import SystemSetup from "../components/Right/SystemSetup/SystemSetup";
import ExcelAddInfo from "../components/Right/ExcelAddInfo/ExcelAddInfo";
import RightManage from "../components/Right/RightManage/RightManage";
import Contract from "../components/Contract/Contract";
import InboundRecord from "../components/Material/InboundRecord/InboundRecord";
import OutboundRecord from "../components/Material/OutboundRecord/OutboundRecord";
import ReturnRecord from "../components/Material/ReturnRecord/ReturnRecord";
import DeviceCategory from "../components/Material/DeviceCategory/DeviceCategory";
import MainTenance from "../components/Material/MainTenance/MainTenance";
import IntangibleAssets from "../components/Material/IntangibleAssets/IntangibleAssets";
import Qualification from "../components/Material/Qualification/Qualification";
import OutboundOrder from "../components/Material/OutboundOrder/OutboundOrder";
import ReturnOrder from "../components/Material/ReturnOrder/ReturnOrder";
import ApplyPurchase from "../components/Purchase/ApplyPurchase/ApplyPurchase";
import Purchase from "../components/Purchase/Purchase/Purchase";
import Customer from "../components/Customer/Customer";
import Document from "../components/Document/Document";
import MessageTable from "../components/OtherManagement/MessageTable";
import ReportMian from "../components/ReportManagement/Report/ReportMian";
import ProjectManagement from "../components/Project/ProjectManagement";
//数据修改
import ModuleManage from "../components/Right/ModuleManage/ModuleManage";
import UserInfo from "../components/UserInfo/UserInfo";
import Department from "../components/UserInfo/Department/Department";
import PosiTionMain from "../components/UserInfo/PosiTionMain/PosiTionMain";
import AttendanceDD from "../components/UserInfo/AttendanceDD/AttendanceDD";
import AttendanceSet from "../components/UserInfo/AttendanceSet/AttendanceSet";
import SalaryStructure from "../components/UserInfo/SalaryStructure/SalaryStructure";

//汽车管理
 import VehicleManagement from "../components/VehicleManagement/VehicleManagement/VehicleManagement";//汽车列表
 import UsageRecord from "../components/VehicleManagement/UsageRecord/UsageRecord";        //使用记录
import CarLedger from "../components/VehicleManagement/CarLedger/CarLedger";             // 汽车消费台账
import GasCardsRecord from "../components/VehicleManagement/GasCardsRecord/GasCardsRecord";        //油卡管理
import PrivateCarUtility from "../components/VehicleManagement/PrivateCarUtility/PrivateCarUtility";  //私车公用
import Ticketrecord from "../components/VehicleManagement/Ticketrecord/Ticketrecord";    //保养\保险\年检

// 公章模块
import OfficialSealAdmin from "../components/OfficialSeal/OfficialSealAdmin/OfficialSealAdmin";
import OfficialSealData from "../components/OfficialSeal/OfficialSealData/OfficialSealData";

import Certificate from "../components/Document/Certificate";
import WebsiteAccount from "../components/Document/WebsiteAccount"

import Main from "../components/Main"
import MaterialList from "../components/Material/MaterialList";
import Index from "../components/Index/Index.vue";
import payrollForm from "../components/Project/Payroll/payrollForm"
import ProjectFinanceTable from "../components/Project/ProjectFinanceTable"
import Reimbursement from "../components/Financemanagement/Project/Reimbursement"
import GeneralDocuments from "../components/GeneralDocuments"


Vue.use(VueRouter)
var router = new VueRouter({
    routes: [
        { path: '/', redirect: '/Login' },
        { path: '/Login', component: Login2 },
        { path: '/Login', component: Login2 },
        { path: '/Main', component: Main },
        { path: '/MaterialList', component: MaterialList },
        { path: '/Financemanagement', component: Financemanagement },
        { path: '/FinanceLoan', component: FinanceLoan },
        { path: '/FinanceCategory', component: FinanceCategory },
        { path: '/Finance', component: Finance },
        { path: '/InboundOrder', component: InboundOrder },
        { path: '/FinanceInvoice', component: FinanceInvoice },
        { path: '/FinanceInvoiceManage', component: FinanceInvoiceManage },
        { path: '/FinanceReimbursement', component: FinanceReimbursement },
        { path: '/AuditRule', component: AuditRule },
        { path: '/SystemSetup', component: SystemSetup },
        { path: '/ExcelAddInfo', component: ExcelAddInfo },
        { path: '/RightManage', component: RightManage },
        { path: '/Contract', component: Contract },
        { path: '/InboundRecord', component: InboundRecord },
        { path: '/OutboundRecord', component: OutboundRecord },
        { path: '/ReturnRecord', component: ReturnRecord },
        { path: '/DeviceCategory', component: DeviceCategory },
        { path: '/MainTenance', component: MainTenance },
        { path: '/IntangibleAssets', component: IntangibleAssets },
        { path: '/Qualification', component: Qualification },
        { path: '/OutboundOrder', component: OutboundOrder },
        { path: '/ReturnOrder', component: ReturnOrder },
        { path: '/ApplyPurchase', component: ApplyPurchase },
        { path: '/Purchase', component: Purchase },
        { path: '/Customer', component: Customer },
        { path: '/Document', component: Document },
        { path: '/MessageTable', component: MessageTable },
        //修改
        { path: '/ModuleManage', component: ModuleManage },
        { path: '/UserInfo', component: UserInfo },
        { path: '/Department', component: Department },
        { path: '/ReportMian', component: ReportMian },
        { path: '/PosiTionMain', component: PosiTionMain },
        { path: '/AttendanceDD', component: AttendanceDD },
        { path: '/AttendanceSet', component: AttendanceSet },
        { path: '/SalaryStructure', component: SalaryStructure },
        //汽车管理
        { path: '/VehicleManagement', component: VehicleManagement },//汽车列表
        { path: '/CarLedger', component: CarLedger },                      // 汽车消费台账
        { path: '/GasCardsRecord', component: GasCardsRecord },           //油卡管理
        { path: '/PrivateCarUtility', component: PrivateCarUtility },   //私车公用
        { path: '/Ticketrecord', component: Ticketrecord },             //保养\保险\年检
        { path: '/UsageRecord', component: UsageRecord },                  //使用记录
        { path: '/Index', component: Index },                  //主页
        { path: '/ProjectManagement', component: ProjectManagement },

        // 公章模块
        {path:'/OfficialSealData',component: OfficialSealData},
        {path:'/OfficialSealAdmin',component: OfficialSealAdmin},

        // 资料管理
        {path:'/Certificate',component: Certificate,title:"证书管理"},
        {path:'/WebsiteAccount',component: WebsiteAccount,title:"账号管理"},
		
		
        {path:'/ProjectFinanceTable',component: ProjectFinanceTable,title:""},
        {path:'/Reimbursement',component: Reimbursement,title:"项目财务报销"},
        {path:'/GeneralDocuments',component: GeneralDocuments,title:"通用文件"},
    ]
})
  router.beforeResolve((to, from, next) => {
     //to将要访问的路径
     // from 代表从那个路径调转
     //next  放行
     if (to.path === '/Login') return next();
      var token = window.sessionStorage.getItem('token');
      if (token == '' || token == undefined) {
         return next('/Login');
      }
      next();
  })
export default router
